//
//  NewViewController.m
//  myDemo2
//
//  Created by wuxueying on 5/12/14.
//
//

#import "NewViewController.h"

@interface NewViewController ()
@end
@implementation NewViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self randomBackgroundColor];
}

- (void)randomBackgroundColor
{
    CGFloat rValue = arc4random() % 256;
    CGFloat gValue = arc4random() % 256;
    CGFloat bValue = arc4random() % 256;
    
    self.view.backgroundColor = [UIColor colorWithRed:rValue/255.0 green:gValue/255.0 blue:bValue/255.0 alpha:1.0];
}

- (IBAction)addNewView:(id)sender {
    UIStoryboard *storyboard = self.storyboard;
    NewViewController *cardViewController = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([NewViewController class])];
    
    [self presentViewController:cardViewController animated:NO completion:nil];
}

@end
